package com.aceona.demo;

import java.util.ArrayList;
import java.util.List;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class JedisCreater {
	public static void main(String[] args) {
		//Redis连接池 
		JedisPoolConfig config = new JedisPoolConfig();
		config.setMaxActive(100000);
		config.setMaxIdle(10);
		config.setMinIdle(5);
		final JedisPool pool = new JedisPool(new JedisPoolConfig(), "172.19.1.122");
		Jedis jedis = pool.getResource();
		
//		String key = "setJedis";
		String key = "kof";
		jedis.sadd(key, "12");
		jedis.sadd(key, "13");
		jedis.sadd(key, "14");
		jedis.sadd(key, "14");
//		jedis.del(key);
//		jedis.zincrby(key, 0, "10");
//		jedis.zincrby(key, 1, "11");
//		jedis.zincrby(key, 2, "12");
//		System.out.println(jedis.zscore(key, "12"));
//		System.out.println(jedis.zrange(key, 0, -1));
//		System.out.println(jedis.zrevrange(key, 0,-1));
		System.out.println(jedis.scard(key));
		jedis.smembers(key.toString());
		System.out.println(jedis.sismember(key, "13"));

        
        //释放Redis连接
        pool.returnResource(jedis);
	}
}
